import Axios from "axios";

/**
 * 上传
 * @param action
 * @param param
 * @param config
 * @returns {Promise<AxiosResponse<T>>}
 */
const uploadFile = function(data,callback){
    let url = window.sysinfo.url;
    return Axios.post(url, data, {
        headers: {'Content-Type': 'multipart/form-data'},
        onUploadProgress:function(ev){
            callback && callback(parseInt((ev.loaded / ev.total)*90));
        }
    });
};

export default uploadFile;
